package com.zzl.finance.data.feign;

import com.zzl.apidoc.annotation.ApidocOperation;
import com.zzl.apidoc.annotation.ApidocParam;
import com.zzl.finance.data.dto.feign.ApproveLogAddDto;
import com.zzl.finance.data.entity.feign.SupplierCreditEntity;
import com.zzl.finance.data.entity.feign.TicketEntity;
import com.zzl.general.common.apidoc.annotation.ApidocReturnR;
import com.zzl.general.common.feign.config.FeignClientsConfig;
import com.zzl.general.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 调用 ticket 服务 feign 方法
 *
 * @author : spp
 * @date : 2021/12/1 09:22
 */
@FeignClient(value = "ticket", configuration = FeignClientsConfig.class)
public interface TicketFeign {

    /**
     * 获取 企业的授信总额度 以及在各个银行的额度
     *
     * @param enterpriseIds 企业id 集合
     * @return 企业授信额度
     */
    @PostMapping("ticket/feign/getEnterpriseQuota")
    Map<Integer, List<SupplierCreditEntity>> getEnterpriseQuota(@RequestBody List<String> enterpriseIds);

    @GetMapping("ticket/feign/getInstitutyCredit")
    Map<Integer, Double> getInstitutyCredit();

    /**
     * 我的票据信息
     *
     * @param id 票据id
     * @return 票据对象
     */
    @GetMapping("/ticket/info/{id}")
    TicketEntity ticketInfo(@ApidocParam(name = "我的票据id", required = true) @PathVariable("id") Integer id);

}
